home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / mcstr_32.zip / MSTRDEMO.BAS < prev    next >
BASIC Source File  |  1996-06-25  |  2KB  |  79 lines

  1. Attribute VB_Name = "MCSTRINGDEMO_BAS"
  2. Option Explicit
  3.  
  4. Public Const RandI = 32767
  5. Public Const RandL = 2147483647
  6. Public Const RandS = 1E+10!
  7. Public Const RandD = 1E+16
  8.  
  9. Public T2WDirInst       As String
  10. Public T2WDirTest       As String
  11. Public T2WFileTest      As String
  12.  
  13.  
  14. Public Sub sub_Load_Combo(Cmb As Control, strFile As String)
  15.  
  16.    Dim intStatus        As Integer
  17.    Dim strTmp           As String
  18.    
  19.    On Error GoTo ErrorLoadCombo
  20.    
  21.    Close #1
  22.    Open strFile For Input Shared As #1
  23.    
  24.    While Not EOF(1)
  25.       Line Input #1, strTmp
  26.       Cmb.AddItem strTmp
  27.    Wend
  28.    
  29.    Cmb.ListIndex = 0
  30.    
  31.    Exit Sub
  32.    
  33. ErrorLoadCombo:
  34.  
  35.    MsgBox ("File '" & strFile & "' can't be loaded !")
  36.    Resume Next
  37.  
  38. End Sub
  39.  
  40.  
  41. Public Sub sub_Check_Project()
  42.  
  43.    On Error GoTo ErrorCheckProject
  44.  
  45.    T2WDirInst = App.Path + "\"
  46.    
  47.    Close #1
  48.    Open T2WDirInst + "MCSTR-32.VBP" For Input Shared As #1
  49.    Close #1
  50.    
  51.    Exit Sub
  52.    
  53. ErrorCheckProject:
  54.  
  55.    MsgBox "'MC-STRING (32-Bit)' demo not found" & vbCrLf & vbCrLf & "Place all demo files in the same directory"
  56.    Resume Next
  57.    
  58. End Sub
  59.  
  60. Public Sub sub_NextPrev(Cmb As Control, Index As Integer)
  61.    
  62.    Dim n          As Integer
  63.    Dim t          As Integer
  64.    
  65.    n = Cmb.ListIndex
  66.    t = Cmb.ListCount - 1
  67.    
  68.    If (Index = 0) Then
  69.       n = n - 1
  70.       If (n < 0) Then n = 0
  71.    Else
  72.       n = n + 1
  73.       If (n > t) Then n = t
  74.    End If
  75.    
  76.    Cmb.ListIndex = n
  77.    
  78. End Sub
  79.